package com.ktjiaoyu.t313.dao;

import com.ktjiaoyu.t313.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserDao {

    SysUser findUserByNameAndPassword(@Param("account") String userName,@Param("password") String password);

    List<SysUser> selectList(@Param("realName") String userName,@Param("roleId") Integer roleId,
                             @Param("currentPageNo") int currentPageNo,@Param("pageSize") int pageSize);

    int selectCount(@Param("realName") String realName,@Param("roleId") Integer roleId);

    /**
     * 新增用户信息
     * @param sysUser
     * @return
     */
    int addUser(SysUser sysUser);

    /**
     * 通过userCode获取User
     * @param account
     * @return
     * @throws Exception
     */
    SysUser selectByAccount(@Param("account") String account)throws Exception;

    /**
     * 通过ID查询用户信息
     * @param id
     * @return
     */
    SysUser getUserById(@Param("id") Integer id)throws Exception;
}